package com.eshop.we.controller;


import com.baomidou.mybatisplus.plugins.Page;
import com.eshop.we.accountdetail.dto.AccountDetailDto;
import com.eshop.we.business.AccountBusiness;
import com.eshop.we.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/account")
public class AccountController extends  BaseController {

    @Autowired
    AccountBusiness accountBusiness;

    @GetMapping("/getaccountpage")
    public Result getAccountPage(@RequestParam(required = false)String name,@RequestParam(required = false)String mobile,
                                 @RequestParam(required = false)String startDate,@RequestParam(required = false)String endDate,
                                 @RequestParam(required = false,defaultValue = "1")Integer pageNum, @RequestParam(required = false,defaultValue = "20")Integer pageSize){

        Page<AccountDetailDto> page=new Page<>(pageNum,pageSize);
        page=accountBusiness.selectAccountDetailPage(page,name,mobile,startDate,endDate);
        return Result.success(page);
    }
}
